package com.miyake.dsp.otdr;

import com.miyake.dsp.ComplexArray;
import com.miyake.dsp.OctaveExecute;
import com.miyake.dsp.OctaveFactory;
import com.miyake.dsp.Processor;
import com.miyake.dsp.ProcessorFactory;
import com.miyake.dsp.ScilabExecute;
import com.miyake.dsp.convolution.ConvolutionSetting;

public class Otdr implements Processor{

	private OtdrImpulseResponseSetting setting;
	private ComplexArray source;
	
	public Otdr(OtdrImpulseResponseSetting setting) {
		this.setting = setting;
	}
	
	@Override
	public void setSource(ComplexArray source) {
		this.source = source;
	}

	@Override
	public ComplexArray getProcessed() {
		return new ComplexArray(getTrace(), null);
	}

	private double[] getTrace() {
		//double[] impulse = setting.getEntryPoint().getImpulseResponse(1, 1.0 / setting.getFrequency() * 3e8);
		double[] impulse = setting.getTrace();
		return impulse;
	}

	@Override
	public ComplexArray getSource() {
		return this.source;
	}

	@Override
	public Object getSetting() {
		return setting;
	}
}
